package com.qiwenshare.file.api;

import com.qiwenshare.common.result.RestResult;
import com.qiwenshare.file.domain.Department;
import com.qiwenshare.file.vo.department.DepartmentTreeVo;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;

import java.util.List;

/**
 * 部门表(Department)表服务接口
 *
 * @author makejava
 * @since 2023-09-16 19:52:33
 */
public interface IDepartmentService {

    List<DepartmentTreeVo> selectDepartmentTree(String departmentName);

    List<Department> getList();

    /**
     * 通过ID查询单条数据
     *
     * @param departmentId 主键
     * @return 实例对象
     */
    Department queryById(String departmentId);

    /**
     * 分页查询
     *
     * @param department  筛选条件
     * @param pageRequest 分页对象
     * @return 查询结果
     */
    Page<Department> queryByPage(Department department, PageRequest pageRequest);

    /**
     * 新增数据
     *
     * @param department 实例对象
     * @return 实例对象
     */
    RestResult<String> insert(Department department);

    /**
     * 修改数据
     *
     * @param department 实例对象
     * @return 实例对象
     */
    RestResult<String> update(Department department);

    /**
     * 通过主键删除数据
     *
     * @param departmentId 主键
     * @return 是否成功
     */
    RestResult<String> deleteById(String departmentId);

}
